{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## SQLite Database"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-05T14:34:44.266590Z",
     "start_time": "2018-09-05T14:34:44.257617Z"
    }
   },
   "outputs": [],
   "source": [
    "import sqlite3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## How to connect with database in Python?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1. Import database module<br /><br />\n",
    "<code>import sqlite3</code><br /><br />\n",
    "\n",
    "2. Establish connection between python program and db<br /><br />\n",
    "<code>con = sqlite3.connect(database)</code><br /><br />\n",
    "\n",
    "3. To execute mysql query and hold result cursor is required<br /><br />\n",
    "<code>cursor = con.cursor()</code><br /><br />\n",
    "\n",
    "4. Execute MySql query with the help of cursor object<br /><br />\n",
    "<code>cursor.execute(query)</code><br /><br />\n",
    "<code>cursor.executemany()</code><br /><br />\n",
    "\n",
    "5. fetch the result from cursor object in case of select query<br /><br />\n",
    "<code>cursor.fetchone()</code><br /><br />\n",
    "<code>cursor.fetchall()</code><br /><br />\n",
    "<code>cursor.fetchmany(n)</code><br /><br />\n",
    "\n",
    "6. commit or rollback changes based on your requirement<br /><br />\n",
    "<code>con.commit()</code><br /><br />\n",
    "<code>con.rollback()</code><br /><br />\n",
    "\n",
    "7. close the resources and disconnect database<br /><br />\n",
    "<code>cursor.close()</code><br /><br />\n",
    "<code>con.close()</code><br /><br />"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T04:35:30.955307Z",
     "start_time": "2018-09-06T04:35:30.949322Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Opened database successfully\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "con = sqlite3.connect('data/kanav.db')\n",
    "\n",
    "print(\"Opened database successfully\")\n",
    "\n",
    "con.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T03:41:31.951256Z",
     "start_time": "2018-09-06T03:41:31.945174Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<sqlite3.Connection object at 0x000001C1DE2CA4E0>\n",
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('data/kanav.db')\n",
    "    print(con)\n",
    "    \n",
    "finally:\n",
    "    con.close()\n",
    "    print('DONE!!')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Creating Database Table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T04:50:12.071994Z",
     "start_time": "2018-09-06T04:50:11.866034Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Table created successfully!!\n",
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('kanav.db')\n",
    "    \n",
    "    cursor = con.cursor()\n",
    "    \n",
    "    query = 'create table employees(eno int(5) primary key, \\\n",
    "    ename varchar(10), eage int(3))'\n",
    "    \n",
    "    cursor.execute(query)\n",
    "    \n",
    "    print('Table created successfully!!')\n",
    "    con.commit()\n",
    "    \n",
    "except sqlite3.DatabaseError as e:\n",
    "    if con:\n",
    "        con.rollback()\n",
    "        print('Problem occured: ', e)\n",
    "    \n",
    "finally:\n",
    "    if cursor:\n",
    "        cursor.close()\n",
    "    if con:\n",
    "        con.close()\n",
    "    print('DONE!!')\n",
    "    \n",
    "# '''\n",
    "# query = 'create table employees1(eno int(5) primary key, \\\n",
    "#     ename varchar(10), eage int(3), eincome double(10,2), \\\n",
    "#     foreign key(eno) references employees(eno))'\n",
    "# '''"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Adding new columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T04:50:13.653707Z",
     "start_time": "2018-09-06T04:50:13.428264Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Column added Successfully!!\n",
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('kanav.db')\n",
    "    \n",
    "    cursor = con.cursor()\n",
    "    \n",
    "    query = 'alter table employees add column eincome double(10,2)'\n",
    "    \n",
    "    cursor.execute(query)\n",
    "    \n",
    "    print('Column added Successfully!!')\n",
    "    con.commit()\n",
    "    \n",
    "except sqlite3.DatabaseError as e:\n",
    "    if con:\n",
    "        con.rollback()\n",
    "        print('Problem occured: ', e)\n",
    "    \n",
    "finally:\n",
    "    if cursor:\n",
    "        cursor.close()\n",
    "    if con:\n",
    "        con.close()\n",
    "    print('DONE!!')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Insert Operation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T04:50:15.761693Z",
     "start_time": "2018-09-06T04:50:15.549264Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Row inserted Successfully\n",
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('kanav.db')\n",
    "    \n",
    "    cursor = con.cursor()\n",
    "    \n",
    "    query = \"insert into employees(eno, ename, eage, eincome) \\\n",
    "    values(1,'lmn',30,70000)\"\n",
    "    \n",
    "    cursor.execute(query)\n",
    "    \n",
    "    con.commit()\n",
    "    \n",
    "    print('Row inserted Successfully')\n",
    "    \n",
    "except sqlite3.DatabaseError as e:\n",
    "    if con:\n",
    "        con.rollback()\n",
    "        print('Problem occured: ', e)\n",
    "    \n",
    "finally:\n",
    "    if cursor:\n",
    "        cursor.close()\n",
    "    if con:\n",
    "        con.close()\n",
    "    print('DONE!!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T04:57:18.249821Z",
     "start_time": "2018-09-06T04:57:18.049364Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('kanav.db')\n",
    "    \n",
    "    cursor = con.cursor()\n",
    "    \n",
    "    query = \"insert into employees(eno, ename, eage, eincome) \\\n",
    "    values(?,?,?,?)\"\n",
    "    \n",
    "    records = [(3, 'xyz', 33, 40000),(4, 'abc', 23, 23000)]\n",
    "    \n",
    "    cursor.executemany(query, records)\n",
    "    \n",
    "    con.commit()\n",
    "    \n",
    "except sqlite3.DatabaseError as e:\n",
    "    if con:\n",
    "        con.rollback()\n",
    "        print('Problem occured: ', e)\n",
    "    \n",
    "finally:\n",
    "    if cursor:\n",
    "        cursor.close()\n",
    "    if con:\n",
    "        con.close()\n",
    "    print('DONE!!')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Read Operation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T05:35:55.277742Z",
     "start_time": "2018-09-06T05:35:55.267745Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Eno: 1, Ename: lmn, Eage: 30, Esal: 70000.0\n",
      "Eno: 3, Ename: xyz, Eage: 33, Esal: 40000.0\n",
      "Eno: 4, Ename: abc, Eage: 23, Esal: 23000.0\n",
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('kanav.db')\n",
    "    \n",
    "    cursor = con.cursor()\n",
    "    \n",
    "    query = 'select * from employees'\n",
    "    \n",
    "    cursor.execute(query)\n",
    "    \n",
    "    data = cursor.fetchall()\n",
    "    \n",
    "    for row in data:\n",
    "        print('Eno: {}, Ename: {}, Eage: {}, Esal: {}'\\\n",
    "             .format(row[0], row[1], row[2], row[3]))\n",
    "    \n",
    "except sqlite3.DatabaseError as e:\n",
    "    if con:\n",
    "        con.rollback()\n",
    "        print('Problem occured: ', e)\n",
    "    \n",
    "finally:\n",
    "    if cursor:\n",
    "        cursor.close()\n",
    "    if con:\n",
    "        con.close()\n",
    "    print('DONE!!')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Update Operation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T05:34:47.856180Z",
     "start_time": "2018-09-06T05:34:47.650045Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('kanav.db')\n",
    "    \n",
    "    cursor = con.cursor()\n",
    "    \n",
    "    query = \"update employees set eage=eage+1 where ename = 'lmn'\"\n",
    "    \n",
    "    cursor.execute(query)\n",
    "    \n",
    "    con.commit()\n",
    "    \n",
    "except sqlite3.DatabaseError as e:\n",
    "    if con:\n",
    "        con.rollback()\n",
    "        print('Problem occured: ', e)\n",
    "    \n",
    "finally:\n",
    "    if cursor:\n",
    "        cursor.close()\n",
    "    if con:\n",
    "        con.close()\n",
    "    print('DONE!!')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Delete Operation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-09-06T05:35:44.035123Z",
     "start_time": "2018-09-06T05:35:34.052718Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enter age: 31\n",
      "DONE!!\n"
     ]
    }
   ],
   "source": [
    "import sqlite3\n",
    "\n",
    "try:\n",
    "    con = sqlite3.connect('kanav.db')\n",
    "    \n",
    "    cursor = con.cursor()\n",
    "    \n",
    "    age = input('Enter age: ')\n",
    "    \n",
    "    query = \"delete from employees where eage={}\".format(age)\n",
    "    \n",
    "    cursor.execute(query)\n",
    "    \n",
    "    con.commit()\n",
    "    \n",
    "except sqlite3.DatabaseError as e:\n",
    "    if con:\n",
    "        con.rollback()\n",
    "        print('Problem occured: ', e)\n",
    "    \n",
    "finally:\n",
    "    if cursor:\n",
    "        cursor.close()\n",
    "    if con:\n",
    "        con.close()\n",
    "    print('DONE!!')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Reading Database to Pandas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>EmployeeName</th>\n",
       "      <th>JobTitle</th>\n",
       "      <th>BasePay</th>\n",
       "      <th>OvertimePay</th>\n",
       "      <th>OtherPay</th>\n",
       "      <th>Benefits</th>\n",
       "      <th>TotalPay</th>\n",
       "      <th>TotalPayBenefits</th>\n",
       "      <th>Year</th>\n",
       "      <th>Notes</th>\n",
       "      <th>Agency</th>\n",
       "      <th>Status</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>NATHANIEL FORD</td>\n",
       "      <td>GENERAL MANAGER-METROPOLITAN TRANSIT AUTHORITY</td>\n",
       "      <td>167411.18</td>\n",
       "      <td>0</td>\n",
       "      <td>400184.25</td>\n",
       "      <td></td>\n",
       "      <td>567595.43</td>\n",
       "      <td>567595.43</td>\n",
       "      <td>2011</td>\n",
       "      <td></td>\n",
       "      <td>San Francisco</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>GARY JIMENEZ</td>\n",
       "      <td>CAPTAIN III (POLICE DEPARTMENT)</td>\n",
       "      <td>155966.02</td>\n",
       "      <td>245131.88</td>\n",
       "      <td>137811.38</td>\n",
       "      <td></td>\n",
       "      <td>538909.28</td>\n",
       "      <td>538909.28</td>\n",
       "      <td>2011</td>\n",
       "      <td></td>\n",
       "      <td>San Francisco</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>ALBERT PARDINI</td>\n",
       "      <td>CAPTAIN III (POLICE DEPARTMENT)</td>\n",
       "      <td>212739.13</td>\n",
       "      <td>106088.18</td>\n",
       "      <td>16452.6</td>\n",
       "      <td></td>\n",
       "      <td>335279.91</td>\n",
       "      <td>335279.91</td>\n",
       "      <td>2011</td>\n",
       "      <td></td>\n",
       "      <td>San Francisco</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>CHRISTOPHER CHONG</td>\n",
       "      <td>WIRE ROPE CABLE MAINTENANCE MECHANIC</td>\n",
       "      <td>77916</td>\n",
       "      <td>56120.71</td>\n",
       "      <td>198306.9</td>\n",
       "      <td></td>\n",
       "      <td>332343.61</td>\n",
       "      <td>332343.61</td>\n",
       "      <td>2011</td>\n",
       "      <td></td>\n",
       "      <td>San Francisco</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>PATRICK GARDNER</td>\n",
       "      <td>DEPUTY CHIEF OF DEPARTMENT,(FIRE DEPARTMENT)</td>\n",
       "      <td>134401.6</td>\n",
       "      <td>9737</td>\n",
       "      <td>182234.59</td>\n",
       "      <td></td>\n",
       "      <td>326373.19</td>\n",
       "      <td>326373.19</td>\n",
       "      <td>2011</td>\n",
       "      <td></td>\n",
       "      <td>San Francisco</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Id       EmployeeName                                        JobTitle  \\\n",
       "0   1     NATHANIEL FORD  GENERAL MANAGER-METROPOLITAN TRANSIT AUTHORITY   \n",
       "1   2       GARY JIMENEZ                 CAPTAIN III (POLICE DEPARTMENT)   \n",
       "2   3     ALBERT PARDINI                 CAPTAIN III (POLICE DEPARTMENT)   \n",
       "3   4  CHRISTOPHER CHONG            WIRE ROPE CABLE MAINTENANCE MECHANIC   \n",
       "4   5    PATRICK GARDNER    DEPUTY CHIEF OF DEPARTMENT,(FIRE DEPARTMENT)   \n",
       "\n",
       "     BasePay OvertimePay   OtherPay Benefits   TotalPay  TotalPayBenefits  \\\n",
       "0  167411.18           0  400184.25           567595.43         567595.43   \n",
       "1  155966.02   245131.88  137811.38           538909.28         538909.28   \n",
       "2  212739.13   106088.18    16452.6           335279.91         335279.91   \n",
       "3      77916    56120.71   198306.9           332343.61         332343.61   \n",
       "4   134401.6        9737  182234.59           326373.19         326373.19   \n",
       "\n",
       "   Year Notes         Agency Status  \n",
       "0  2011        San Francisco         \n",
       "1  2011        San Francisco         \n",
       "2  2011        San Francisco         \n",
       "3  2011        San Francisco         \n",
       "4  2011        San Francisco         "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "from sqlalchemy import create_engine\n",
    "  \n",
    "# SQLAlchemy connectable\n",
    "engine = create_engine('sqlite:///data/database.sqlite')\n",
    "conn = engine.connect()\n",
    "  \n",
    "# table named 'Salaries' will be returned as a dataframe.\n",
    "df = pd.read_sql_table('Salaries', conn)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Salaries']\n"
     ]
    }
   ],
   "source": [
    "# Check all tablenames inside a database\n",
    "\n",
    "from sqlalchemy import inspect\n",
    "\n",
    "inspect = inspect(engine)\n",
    "\n",
    "print(inspect.get_table_names())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>MAX(TotalPay)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>567595.43</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   MAX(TotalPay)\n",
       "0      567595.43"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# SQLite Implementation\n",
    "\n",
    "output = pd.read_sql_query(\"\"\"SELECT MAX(TotalPay) FROM Salaries\"\"\", conn)\n",
    "output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "567595.43"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Pandas Implementation - 1\n",
    "\n",
    "max(df.TotalPay)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>TotalPay</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>567595.43</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    TotalPay\n",
       "0  567595.43"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Pandas Implementation - 2\n",
    "# Syntax - dataframe.loc[row, index]\n",
    "\n",
    "df.loc[df.TotalPay == max(df.TotalPay), ['TotalPay']]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "toc": {
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
